﻿Imports System.ComponentModel
Imports System.Drawing
Imports System.ComponentModel.Design


Public NotInheritable Class ContourPropConvertor
    Inherits TypeConverter

End Class

'Public Enum LINECOLORMODE
'    SELFDEF
'    AUTOCOMPUTE
'End Enum

'Public Enum POLYGONCOLORMODE

'    SELFDEF
'    AUTOCOMPUTE

'End Enum

'Public Enum CONTOURGENERATIONMODE
'    SELFDEF
'    AUTOCOMPUTE
'End Enum

'<PersistenceMode(PersistenceMode.Attribute)> _
'<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _


Public Class ContourSub


    Public Sub New()

        v = 0.0
        clr = Color.White
        LineClr = Color.Black

        bShowPoly = True




    End Sub


    Dim v As Double
    <CategoryAttribute("基本信息"), _
    NotifyParentProperty(True), _
DisplayName("等值线值")> _
Public Property VProperty() As Double
        Get
            Return v
        End Get
        Set(ByVal value As Double)
            v = value
        End Set
    End Property


    Dim clr As Drawing.Color
    <CategoryAttribute("基本信息"), _
    NotifyParentProperty(True), _
  DisplayName("等值线内填充色")> _
   Public Property ClrProperty() As Drawing.Color
        Get
            Return clr
        End Get
        Set(ByVal value As Drawing.Color)
            clr = value
        End Set
    End Property

    Dim LineClr As Drawing.Color
    <CategoryAttribute("基本信息"), _
    NotifyParentProperty(True), _
  DisplayName("等值线颜色")> _
    Public Property LnColorProperty() As Drawing.Color
        Get
            Return LineClr
        End Get
        Set(ByVal value As Drawing.Color)
            LineClr = value
        End Set
    End Property

    Dim bShowPoly As Boolean
    <CategoryAttribute("基本信息"), _
    NotifyParentProperty(True), _
DisplayName("是否显示")> _
  Public Property BShowPolyProperty() As Boolean
        Get
            Return bShowPoly
        End Get
        Set(ByVal value As Boolean)
            bShowPoly = value
        End Set
    End Property


End Class







Public Class ContourProp
    Inherits GPropLayer
    Public Sub New(ByVal ln As String, ByVal fn As String, ByVal lt As LAYERTYPE, ByVal bs As Boolean)
        MyBase.New(ln, fn, lt, bs)

        'lmode = LINECOLORMODE.AUTOCOMPUTE
        'gmode = POLYGONCOLORMODE.AUTOCOMPUTE
        'cmode = CONTOURGENERATIONMODE.SELFDEF


        cList = New List(Of ContourSub)
        GradientClrPolygon = New List(Of Color)
        GradientClrPolygon.Add(Color.Yellow)
        GradientClrPolygon.Add(Color.FromArgb(255, 128, 0))
        GradientClrPolygon.Add(Color.FromArgb(255, 128, 128))
        GradientClrPolygon.Add(Color.Red)

        GradientClrLine = New List(Of Color)
        GradientClrLine.Add(Color.Black)
        ' GradientClrLine.Add(Color.Red)





    End Sub


    Public Event vListChanged(ByVal ln As String, ByVal lt As List(Of ContourSub))


#Region "模式属性完毕"
    '    Dim lmode As LINECOLORMODE
    '    <CategoryAttribute("生成模式"), _
    'DisplayName("线颜色模式")> _
    '    Public Property LmodeProperty() As LINECOLORMODE
    '        Get
    '            Return lmode
    '        End Get
    '        Set(ByVal value As LINECOLORMODE)
    '            lmode = value
    '        End Set
    '    End Property

    '    Dim gmode As POLYGONCOLORMODE
    '    <CategoryAttribute("生成模式"), _
    'DisplayName("填充颜色模式")> _
    '   Public Property GmodeProperty() As POLYGONCOLORMODE
    '        Get
    '            Return gmode
    '        End Get
    '        Set(ByVal value As POLYGONCOLORMODE)
    '            gmode = value
    '        End Set
    '    End Property

    '    Dim cmode As CONTOURGENERATIONMODE
    '    <CategoryAttribute("生成模式"), _
    'DisplayName("等值线生成模式")> _
    '   Public Property CmodeProperty() As CONTOURGENERATIONMODE
    '        Get
    '            Return cmode
    '        End Get
    '        Set(ByVal value As CONTOURGENERATIONMODE)
    '            cmode = value
    '        End Set
    '    End Property

#End Region


  


    Dim GradientClrPolygon As List(Of Color)
    <CategoryAttribute("颜色集合"), _
DisplayName("填充渐变色集合")> _
    Public Property PolyGradientListProperty() As List(Of Color)
        Get
            Return GradientClrPolygon
        End Get
        Set(ByVal value As List(Of Color))
            GradientClrPolygon = value
        End Set
    End Property

    Dim GradientClrLine As List(Of Color)
    <CategoryAttribute("颜色集合"), _
DisplayName("线条渐变色集合")> _
  Public Property LineGradientListProperty() As List(Of Color)
        Get
            Return GradientClrLine
        End Get
        Set(ByVal value As List(Of Color))
            GradientClrLine = value
        End Set
    End Property

    Dim cList As List(Of ContourSub)
    <CategoryAttribute("等值线"), _
   BrowsableAttribute(True), _
 DisplayName("等值线属性集合")> _
  Public Property CListProperty() As List(Of ContourSub)
        Get
            Return cList
        End Get
        Set(ByVal value As List(Of ContourSub))
            cList = value
            RaiseEvent vListChanged(Me.LnameProperty, cList)
        End Set
    End Property


#Region "基类隐藏属性"



    '重写的一些属性,下面主要是与点相关的部分，呵呵
    <CategoryAttribute("外观设置"), _
   DisplayName("点类型"), _
   BrowsableAttribute(False)> _
   Public Overrides Property PointtypeProperty() As MapWinGIS.tkPointType
        Get

        End Get
        Set(ByVal value As MapWinGIS.tkPointType)



        End Set
    End Property

    <BrowsableAttribute(False)> _
   Public Overrides Property PointColorProperty() As Color
        Get

        End Get
        Set(ByVal value As Color)

        End Set
    End Property


    <BrowsableAttribute(False)> _
    Public Overrides Property PointsizeProperty() As Double
        Get

        End Get
        Set(ByVal value As Double)

        End Set
    End Property



    <BrowsableAttribute(False)> _
    Public Overrides Property PtUdpImgProperty() As String
        Get

        End Get

        Set(ByVal value As String)

        End Set
    End Property


#End Region


End Class

